﻿using Dropit.Extension.Core;
using SocialPack.Composer.Extensions;

namespace SocialPack.Composer.modules.SocialPack.Composer.Functions.Linkedin
{
    public partial class MemberProfile : BaseContentFunction
    {
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            if (ContentFunctionData.IsValue("PublicProfileUrl"))
            {
                this.MemberProfileControl.PublicProfileUrl = ContentFunctionData.Property["PublicProfileUrl"].ToString();
            }

            if (ContentFunctionData.IsValue("Text"))
            {
                this.MemberProfileControl.Text = ContentFunctionData.Property["Text"].ToString();
            }

            if (ContentFunctionData.IsValue("ShowConnections"))
            {
                this.MemberProfileControl.ShowConnections = (bool)ContentFunctionData.Property["ShowConnections"].Value;
            }
        }
    }
}